package com.qf.auth.api;

import com.qf.auth.service.TenantService;
import com.qf.common.bean.R;
import com.qf.common.dto.TenantDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 租户注册认证业务
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/auth/tenant")
public class TenantController {

    @Autowired
    private TenantService tenantService;

    /**
     * 租户注册
     * @param dto
     * @return
     */
    @PostMapping("/regist")
    public R register(@RequestBody TenantDto dto) {
        R result = tenantService.register(dto);
        return result;
    }

    /**
     * 租户登录
     * @param dto
     * @return
     */
    @PostMapping("/login")
    public R login(@RequestBody TenantDto dto) {
        R result = tenantService.login(dto);
        return result;
    }

}
